times = cell(1,5);

times {1} = global_times_dec_10K;
times {2} = global_times_dec_100K;
times {3} = global_times_rand_400K;
times {4} = global_times_rand_700K;
times {5} = global_times_dec_1M;

hold on

global_times_mean = [];
global_times_std = []

tmp = times{1};
global_times_mean = [global_times_mean mean(tmp(:,5))]
global_times_std = [global_times_std std(tmp(:,5))]

tmp = times{2};
global_times_mean = [global_times_mean mean(tmp(:,5))]
global_times_std = [global_times_std std(tmp(:,5))]
%plot([100000],global_times_mean,'-o', 'linewidth',2)


tmp = times{3};
global_times_mean = [global_times_mean mean(tmp(:,5))]
global_times_std = [global_times_std std(tmp(:,5))]
%plot([400000],global_times_mean,'-o', 'linewidth',2)
 
tmp = times{4};
global_times_mean = [global_times_mean mean(tmp(:,5))]
global_times_std = [global_times_std std(tmp(:,5))]
%plot([700000],global_times_mean,'-o', 'linewidth',2)
 
tmp = times{5};
global_times_mean = [global_times_mean mean(tmp(:,5))]
global_times_std = [global_times_std std(tmp(:,5))]
plot([10000 100000 400000 700000 1000000],global_times_mean,'c-o', 'linewidth',2)
axis([0 1.01*10^6 0 300]) 
xlabel('# of elements');
ylabel('time (ms)');


times {1} = global_times_merge_dec_10K;
times {2} = global_times_merge_dec_100K;
times {3} = global_times_merge_rand_400K;
times {4} = global_times_merge_rand_700K;
times {5} = global_times_merge_dec_1M;

hold on


global_times_mean = [];
global_times_std = []

tmp = times{1};
global_times_mean = [global_times_mean mean(tmp(:,5))]
global_times_std = [global_times_std std(tmp(:,5))]

tmp = times{2};
global_times_mean = [global_times_mean mean(tmp(:,5))]
global_times_std = [global_times_std std(tmp(:,5))]
%plot([100000],global_times_mean,'-o', 'linewidth',2)


tmp = times{3};
global_times_mean = [global_times_mean mean(tmp(:,5))]
global_times_std = [global_times_std std(tmp(:,5))]
%plot([400000],global_times_mean,'-o', 'linewidth',2)
 
tmp = times{4};
global_times_mean = [global_times_mean mean(tmp(:,5))]
global_times_std = [global_times_std std(tmp(:,5))]
%plot([700000],global_times_mean,'-o', 'linewidth',2)
 
tmp = times{5};
global_times_mean = [global_times_mean mean(tmp(:,5))]
global_times_std = [global_times_std std(tmp(:,5))]
plot([10000 100000 400000 700000 1000000],global_times_mean,'m-o', 'linewidth',2)
axis([0 1.01*10^6 0 200]) 
xlabel('# of elements');
ylabel('time (ms)');




legend('samplesort','mergesort')



% global_times_mean = mean(times{1},1)
% global_times_std = std(times{1},1)
% errorbar(0:8,global_times_mean,global_times_std,'b.','linewidth',1);
% 
% global_times_mean = mean(times{2},1)
% global_times_std = std(times{2},1)
% errorbar(0:8,global_times_mean,global_times_std,'m.','linewidth',1);
% 
% global_times_mean = mean(times{3},1)
% global_times_std = std(times{3},1)
% errorbar(0:8,global_times_mean,global_times_std,'g.','linewidth',1);